<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>党员考核积分设置管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			getCheckList=function(){
				var ids = [];
					$("input[name='ids']:checked").each(function(){
						ids.push($(this).val());
					});
				return ids;
			}
			$("#checkAll").on('click', function() {
				var ch = this.checked;  //复选框
				if(ch){
					$("input[name='ids']").prop("checked", true);
				}else{
					$("input[name='ids']").prop("checked", false);
				}
			});
			$("#addBtn").on('click', function() {
				window.location.href="${ctx}/personassessmen/personAssessment/formPersonAssessmentInfo?personAssessment="+$("#personAssessmentId").val();
			});
			$("#updateBtn").on('click', function() {
				var ids =getCheckList();
				if(ids.length!=1){
					alert("请选择一条记录进行修改");
					return false;
				}
				window.location.href="${ctx}/personassessmen/personAssessment/formPersonAssessmentInfo?id="+ids[0].split('|')[0];
			});
			$("#deleBtn").on('click', function() {
				var ids =getCheckList();
				if(ids.length !=1){
					alert("请选择一条记录进行删除");
					return false;
				}
				window.location.href="${ctx}/personassessmen/personAssessment/deletePersonAssessmentInfo?id="+ids[0].split('|')[0];
			});
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/personassessmen/personAssessment/listPersonAssessmentInfo?personAssessment=${personAssessment.id}">
		党员考核积分设置列表&nbsp;&nbsp;&nbsp; (${personAssessment.name }--${personAssessment.partyType.name })  </a></li>
	</ul>
	<form:form id="searchForm" modelAttribute="personAssessmentInfo" 
		action="${ctx}/personassessmen/personAssessment/listPersonAssessmentInfo" 
		method="post" class="breadcrumb form-search">
		<input id="personAssessmentId" name="personAssessmentId" type="hidden" value="${personAssessment.id}"/>
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<input type="hidden" name="ids" id="ids"/> 
		<ul class="ul-form">
			<li class="btns">
			<!-- <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/> -->
			<shiro:hasPermission name="personassessmen:personAssessment:edit">
			<input id="addBtn" class="btn btn-primary" type="button" value="新增"/>
			<input id="updateBtn" class="btn btn-primary" type="button" value="修改"/>
			<!-- <input id="deleBtn" class="btn btn-primary" type="button" value="删除"/> -->
			</shiro:hasPermission></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
			<th width="5%" style='text-align:center'><input type="checkBox" id="checkAll"/></th>
				<th>序号</th>
				<th>积分内容</th>
				<th>分值设定</th>
				<th>积分方式</th>
				<th>上限分数</th>
				<th>赋分方式</th>
				<!-- <th>次数</th>
				<th>周期</th> -->
				<th>上限分/次</th>
				<th>类型</th>
				<th>方式</th>
				<%-- <shiro:hasPermission name="personassessmen:personAssessment:edit"><th>操作</th></shiro:hasPermission> --%>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="personAssessmentInfo" varStatus="rowIndex">
			<tr>
			<td style='text-align:center'><input type='checkbox' name='ids' value='${personAssessmentInfo.id}'/></td>
			<td style='text-align:center' >${personAssessmentInfo.sort}</td>	
				<td style='text-align:center'>
				<a href="${ctx}/personassessmen/personAssessment/formPersonAssessmentInfo?id=${personAssessmentInfo.id}">
					${personAssessmentInfo.title} </a></td>
				<td style='text-align:center' >${personAssessmentInfo.content}</td>
				<td style='text-align:center' >${personAssessmentInfo.assignModl}</td>
				<td style='text-align:center'>
					${personAssessmentInfo.upperScore}
				</td>
				<td style='text-align:center'>
					${fns:getDictLabel(personAssessmentInfo.sourceType, 'Score_mode', '')}
				</td>
			<%-- 	<td>
					${personAssessmentInfo.count}
				</td>
				<td>
					${fns:getDictLabel(personAssessmentInfo.cycle, 'cycle_value', '')}
				</td> --%>
				<td style='text-align:center'>
					${personAssessmentInfo.upperCount}
				</td>
				<td style='text-align:center'>
					${fns:getDictLabel(personAssessmentInfo.type, 'score_type', '')}
				</td>
				<td style='text-align:center'>
					${fns:getDictLabel(personAssessmentInfo.mode, 'declare_scoure', '')}
				</td>
				<%-- <shiro:hasPermission name="personassessmen:personAssessment:edit"><td>
    				<a href="${ctx}/personassessmen/personAssessment/formPersonAssessmentInfo?id=${personAssessmentInfo.id}">修改</a>
				</td></shiro:hasPermission> --%>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>